package br.com.rpinfo.helpdesk;

import java.util.List;
import javax.enterprise.context.RequestScoped;
import javax.inject.Named;

/**
 *
 * @author camilo
 */
@RequestScoped
@Named("clienteBean")
public class ClienteBean {

  private List<Cliente> clientes = null;
  private Cliente cliente = new Cliente();
  private Cliente clienteSelected;

  public Cliente getClienteSelected() {
    return clienteSelected;
  }

  public void setClienteSelected(Cliente clienteSelected) {
    this.clienteSelected = clienteSelected;
  }

  public void salvar() {
    ClienteRn clirn = new ClienteRn();
    clirn.salvar(cliente);
  }

  public void excluir() {
    ClienteRn clirn = new ClienteRn();
    clirn.excluir(clienteSelected);
  }

  public void setClientes(List<Cliente> clientes) {
    this.clientes = clientes;
  }

  public List<Cliente> getClientes() {
    ClienteRn clirn = new ClienteRn();
    return clirn.listar();
  }

  public Cliente getCliente() {
    return cliente;
  }

  public void setCliente(Cliente cliente) {
    this.cliente = cliente;
  }

}
